package org.wmq.travelagency02.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.wmq.travelagency02.mapper.ContactGroupMapper;
import org.wmq.travelagency02.model.Entity.ChatGroup;
import org.wmq.travelagency02.model.Entity.Contact;
import org.wmq.travelagency02.model.Entity.ContactGroup;
import org.wmq.travelagency02.service.ContactGroupService;

import java.util.List;

@Service
@RequiredArgsConstructor
public class ContactGroupServiceImpl extends ServiceImpl<ContactGroupMapper, ContactGroup> implements ContactGroupService {
    private final ContactGroupMapper contactGroupMapper;

    @Override
    public List<ChatGroup> getListByMasterId(String masterId) {
        return this.contactGroupMapper.selectListByMasterId(masterId);
    }

    @Override
    public void removeByMasterId(String masterId) {
        this.lambdaUpdate().eq(ContactGroup::getMasterId,masterId).remove();
    }
}
